package com.chengqj.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * @program: pattern
 * @description: a
 * @author: chengqj
 * @create: 2018-08-08 19:58
 **/
public class Test {
    public static void main(String[] args) {
        ClassLoader loader = DyProxy.class.getClassLoader();
        Class<Person>[] interfaces = new Class[]{Person.class};
        InvocationHandler h = new DyProxy(new ChengqjPerson());
        Person object = (Person) Proxy.newProxyInstance(loader,interfaces,h);
        object.find();
    }
}
